<include file='Common:header' />

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

	<!-- #section:basics/sidebar -->

	<include file='Common:left' />
	<!-- /section:basics/sidebar -->

	<div class="main-content">
		<div class="main-content-inner">
			<div class="page-content">
				<div class="row maintop">

					<div class="col-xs-12 col-sm-3">
						<button class="btn btn-xs btn-danger" data-toggle="modal" data-target="#myModal">
							<i class="ace-icon fa fa-plus bigger-110"></i>
							添加自定义菜单
						</button>
						<a class="red rst-btn" href="{:U('we_menu_make')}">
							<button class="btn btn-xs btn-info" id="we_menu_make">
								<i class="ace-icon fa fa-bolt bigger-110"></i>
								生成菜单
							</button>
						</a>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-12">
						<div>
							<form class="ajaxForm" name="we_menu_order" method="post" action="{:U('we_menu_order')}" >
								<table class="table table-striped table-bordered table-hover" id="dynamic-table">
									<thead>
									<tr>
										<th>ID</th>
										<th>主菜单名称</th>
										<th class="hidden-sm hidden-xs">菜单类型</th>
										<th>菜单状态</th>
										<th class="hidden-sm hidden-xs">菜单操作值</th>
										<th>排序</th>
										<th style="border-right:#CCC solid 1px;">操作</th>
									</tr>
									</thead>

									<tbody>

									<foreach name="we_menu" item="v">
										<tr>
											<td height="28">{$v.we_menu_id}</td>
											<td style='padding-left:<if condition="$v.leftpin neq 0">{$v.leftpin}px</if>' >{$v.lefthtml}{$v.we_menu_name}</td>
											<td class="hidden-sm hidden-xs">{$v.we_menu_type}</td>
											<td>
												<if condition='$v.we_menu_open eq 1'>
													<a class="red display-btn" href="{:U('we_menu_state')}" data-id="{$v.we_menu_id}" title="已显示">
														<div id="zt{$v.we_menu_id}"><button class="btn btn-minier btn-yellow">显示</button></div>
													</a>
													<else/>
													<a class="red display-btn" href="{:U('we_menu_state')}" data-id="{$v.we_menu_id}" title="已隐藏">
														<div id="zt{$v.we_menu_id}"><button class="btn btn-minier btn-danger">隐藏</button></div>
													</a>
												</if>
											</td>
											<td class="hidden-sm hidden-xs">{$v.we_menu_typeval}</td>
											<td><input name="{$v.we_menu_id}" class="list_order" value=" {$v.we_menu_order}" size="3"/></td>
											<td>
												<div class="hidden-sm hidden-xs action-buttons">
													<a class="green menuedit-btn"  href="{:U('we_menu_edit')}" data-id="{$v.we_menu_id}"  title="修改">
														<i class="ace-icon fa fa-pencil bigger-130"></i>
													</a>
													<a class="red confirm-rst-url-btn" data-info="你确定要删除吗？" href="{:U('we_menu_del',array('we_menu_id'=>$v['we_menu_id']))}" title="删除">
														<i class="ace-icon fa fa-trash-o bigger-130"></i>
													</a>
												</div>
												<div class="hidden-md hidden-lg">
													<div class="inline position-relative">
														<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
															<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
														</button>
														<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
															<li>
																<a href="{:U('we_menu_edit')}" data-id="{$v.we_menu_id}" class="tooltip-success menuedit-btn" data-rel="tooltip" title="" data-original-title="修改">
																	<span class="green">
																		<i class="ace-icon fa fa-pencil bigger-120"></i>
																	</span>
																</a>
															</li>

															<li>
																<a href="{:U('we_menu_del',array('we_menu_id'=>$v['we_menu_id']))}" data-info="你确定要删除吗？" class="tooltip-error confirm-rst-url-btn" data-rel="tooltip" title="" data-original-title="删除">
																	<span class="red">
																		<i class="ace-icon fa fa-trash-o bigger-120"></i>
																	</span>
																</a>
															</li>
														</ul>
													</div>
												</div>
											</td>
										</tr>
									</foreach>
									<tr>
										<td colspan="8" align="left"><button type="submit"  id="btnorder" class="btn btn-white btn-yellow btn-sm">排序</button></td>
									</tr>
									</tbody>
								</table>
							</form>
						</div>
					</div>
				</div>
				<include file='Common:header_nav' />


				<!-- 显示添加模态框（Modal）-->
				<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<form class="form-horizontal ajaxForm2" name="we_menu_runadd" method="post" action="{:U('we_menu_runadd')}">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">×
									</button>
									<h4 class="modal-title" id="myModalLabel">
										添加自定义菜单
									</h4>
								</div>
								<div class="modal-body">

									<div class="row">
										<div class="col-xs-12">

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 上级栏目： </label>
												<div class="col-sm-10">
													<select name="we_menu_leftid"  class="col-sm-4 selector" required>
														<option value="0">顶级栏目</option>
														<foreach name="menu_top" item="v">
															<option value="{$v.we_menu_id}">{$v.we_menu_name}</option>
														</foreach>
													</select>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 菜单名称：  </label>
												<div class="col-sm-10">
													<input type="text" name="we_menu_name" id="we_menu_name" placeholder="输入菜单名称" class="col-xs-10 col-sm-5" required/>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 菜单类型： </label>
												<div class="col-sm-10">
													<select name="we_menu_type"  class="col-sm-4" required>
														<option value="1" selected>URL菜单链接</option>
														<option value="2">关键词回复菜单</option>
													</select>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> URL地址：  </label>
												<div class="col-sm-10">
													<input type="text" name="we_menu_typeval" id="we_menu_typeval" placeholder="输入URL地址" class="col-xs-10 col-sm-10" />
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 排序：  </label>
												<div class="col-sm-10">
													<input type="number" name="we_menu_order" id="we_menu_order" value="50" class="col-xs-10 col-sm-2" required/>
													<span class="lbl">&nbsp;&nbsp;<span class="red">*</span>从小到大排序</span>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 是否开启： </label>
												<div class="col-sm-10" style="padding-top:5px;">
													<input name="we_menu_open" id="we_menu_open" value="1" class="ace ace-switch ace-switch-4 btn-flat" type="checkbox" />
													<span class="lbl">&nbsp;&nbsp;默认关闭</span>
												</div>
											</div>
											<div class="space-4"></div>

										</div>
									</div>




								</div>
								<div class="modal-footer">
									<button type="submit" class="btn btn-primary">
										提交保存
									</button>
									<button class="btn btn-info" type="reset">
										重置
									</button>
									<button type="button" class="btn btn-default" data-dismiss="modal">
										关闭
									</button>
								</div>
							</div><!-- /.modal-content -->
						</div><!-- /.modal-dialog -->
					</form>
				</div><!-- /.modal -->








				<!-- 修改自定义菜单模态框（Modal） -->
				<div class="modal fade in" id="myModaledit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
					<div class="modal-backdrop fade in" id="gbbb" style="height: 100%;"></div>
					<form class="form-horizontal ajaxForm2" name="we_menu_runedit" method="post" action="{:U('we_menu_runedit')}">
						<input type="hidden" name="we_menu_id" id="editwe_menu_id" value="" />
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" id="gb"  data-dismiss="modal"
											aria-hidden="true">×
									</button>
									<h4 class="modal-title" id="myModalLabel">
										修改友情链接
									</h4>
								</div>
								<div class="modal-body">


									<div class="row">
										<div class="col-xs-12">

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 上级栏目： </label>
												<div class="col-sm-10">
													<select name="we_menu_leftid"  id="editwe_menu_leftid"  class="col-sm-4 selector" required>
														<option value="0">顶级栏目</option>
														<foreach name="menu_top" item="v">
															<option value="{$v.we_menu_id}">{$v.we_menu_name}</option>
														</foreach>
													</select>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 菜单名称：  </label>
												<div class="col-sm-10">
													<input type="text" name="we_menu_name" id="editwe_menu_name" placeholder="输入菜单名称" class="col-xs-10 col-sm-5" required/>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 菜单类型： </label>
												<div class="col-sm-10">
													<select name="we_menu_type"  class="col-sm-4" id="editwe_menu_type" required>
														<option value="1" selected>URL菜单链接</option>
														<option value="2">关键词回复菜单</option>
													</select>
												</div>
											</div>
											<div class="space-4"></div>

											<div class="form-group">
												<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> URL地址：  </label>
												<div class="col-sm-10">
													<input type="text" name="we_menu_typeval" id="editwe_menu_typeval" placeholder="输入URL地址" class="col-xs-10 col-sm-10" />
												</div>
											</div>
											<div class="space-4"></div>

										</div>
									</div>





								</div>
								<div class="modal-footer">
									<button type="submit" class="btn btn-primary">
										提交保存
									</button>
									<button type="button" class="btn btn-default" id="gbb" >
										关闭
									</button>
								</div>
							</div><!-- /.modal-content -->
						</div><!-- /.modal-dialog -->
					</form>
				</div><!-- /.modal -->
			</div><!-- /.page-content -->
		</div>
	</div><!-- /.main-content -->
	<include file='Common:footer' />

</div><!-- /.main-container -->
</body>
</html>
